package admrouter

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/handlers/pcl/admin/dashboardhandler"
	"yundian/internel/app/middlewares"
	"yundian/internel/pkg/dingo"
)

// 仪表盘 API
func InitDashboardRouter() dingo.ApiRouter {
	return func(g *gin.RouterGroup) {
		{
			g.GET("test/task", dashboardhandler.HandleTestTask)

			// 获取统计信息
			d := g.Group("dashboard")
			d.Use(middlewares.JwtAuthMiddleware)                       // 需要登录
			d.GET("count", dashboardhandler.GetLineCount)              // 总数
			d.GET("rank", dashboardhandler.GetRankList)                // 使用率排行
			d.GET("rank-count", dashboardhandler.GetRankCount)         //d
			d.GET("total-rank", dashboardhandler.GetTotalRankList)     //
			d.GET("pay-count", dashboardhandler.GetPayCountList)       //
			d.GET("balance-rank", dashboardhandler.GetBalanceRankList) //
			d.GET("sales", dashboardhandler.GetSalesList)              //
		}
	}
}
